﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucLogin.ascx.cs" Inherits="Ecreate.Web.usercontrol.ucLogin" %>
<script type="text/javascript"  src="/content/javascript/jquery/jquery-1.3.2.js" ></script>
<script type="text/javascript" language="javascript">
    var homepageurl = "<%=this.info.Homepageurl%>";
    var homepagename = "<%=this.info.Homepagename%>";
    function register() {
        var txt_name = '#<%=this.getName() %>_userName';
        var txt_password = '#<%=this.getName() %>_password';
        var userName = $(txt_name).attr("value");
        var password = $(txt_password).attr("value");
        if (userName == "") {
            alert("请输入用户名");
            $(txt_name).focus();            
            return false;
        }
        if (password == "") {
            alert("请输入密码");
            $(txt_password).focus();
            return false;
        }
    }
</script>
<% if (!this.checkSession()) %>
<%{ %>
    <input type="hidden" name="product" value="163" />
    <input type="hidden" name="type" value="1" />
    <input type="hidden" name="ursname" value="" />
    <div style="float:left;">用户名<asp:TextBox ID="userName" runat="server" Width="60px"></asp:TextBox></div>
    <div style="float:left;">密码<asp:TextBox ID="password" runat="server" TextMode="Password" Width="60px"></asp:TextBox></div>
    <div style="float:left;"><asp:Button ID="btnLogin" runat="server" Text="登陆" onclick="btnLogin_Click"  OnClientClick="return register();" /></div><div style="float:left;"><asp:Button ID="btn_reg" runat="server" Text="注册" OnClientClick="return false;"/></div>   
    <div style="clear:both;">
    <div style="float:left;"><asp:Label ID="lbl_message" runat="server" Text="" Visible="False" ForeColor="#FF3300" ></asp:Label></div>  
    </div>      
 <% } else {%>
    <div style="float:left;"><label for="userName">欢迎用户:<%=this.getUserName()%></label></div>
    <div style="float:left;"><asp:Button ID="btn_edit" runat="server" Text="修改密码" onclick="btn_edit_Click"/></div>                  
    <div style="float:left;"><asp:Button ID="btn_exit" runat="server" Text="退出" onclick="btn_exit_Click"  /></div>   
 <% } %>